package com.first.agent.dao;

import com.first.agent.pojo.AgentDetails;
import com.first.agent.pojo.AgentDetailsJ;
import com.first.agent.pojo.User;
import com.first.agent.pojo.UserJ;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface UserManagementDao {
    //查询所有记录
    List<UserJ> findAll(int page, int limit) throws SQLException;

    //查询记录总条数
    int findCount() throws SQLException;

    //查询单挑记录
    UserJ findUser(int id) throws SQLException;

    //删除一条记录
    int delUser(int id) throws SQLException;

    //通过role查询role对应的role_id
    int findRoleIdByRole(String role) throws SQLException;

    //修改记录
    int modifyById(User user) throws SQLException;

    //查询预付款项目
    List<AgentDetails> findAgentDetail(String username) throws SQLException;

    //查询所有角色ID和角色
    List<Map<String,Object>> findAllRole() throws SQLException;

    //添加user
    int addUser(User user) throws SQLException;

    //查询所有预付款项目
    List<AgentDetailsJ> findAllYu(String username, int page, int limit) throws SQLException;
}
